<?php
// +----------------------------------------------------------------------
// | Description: 1
// +----------------------------------------------------------------------
// | Author: orchief
// +----------------------------------------------------------------------
// | Date: 2018-01-24 17:00:12
// +----------------------------------------------------------------------

namespace app\client\validate;

use think\Validate;

/**
 *
 */
class Base extends Validate
{
    protected $rule = array(
        'code' => 'require',
        'CellPhone' => 'require|regex:/^1[34578]\d{9}$/|unique:shop_members',
        'Password' => 'require',
        'UserName' => 'require|unique:shop_members',
        'ReferUserId' => 'require'
    );
    protected $message = array(
        'code.require' => '请输入验证码',
        'CellPhone.require' => '请输入手机号',
        'Password.require' => '请输入密码',
        'UserName.require' => '请输入用户名',
        'UserName.unique' => '用户名重复',
        'CellPhone.unique' => '手机号已注册',
        'CellPhone.regex' => '手机号错误',
        'ReferUserId.require' => '请扫描推荐二维码获取推荐人!'
    );
    protected $scene = [
        'signUp' => ['code', 'CellPhone', 'Password', 'UserName', 'ReferUserId']
    ];
}
